\(\int \frac {\csc ^4(c+d x)}{(a+b \sec (c+d x))^2} \, dx\) [220]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [F(-2)]
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 343 \[ \int \frac {\csc ^4(c+d x)}{(a+b \sec (c+d x))^2} \, dx=-\frac {2 a^2 b^3 \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{(a-b)^{7/2} (a+b)^{7/2} d}-\frac {4 a^2 b \left (a^2+b^2\right ) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{(a-b)^{7/2} (a+b)^{7/2} d}-\frac {\sin (c+d x)}{12 (a+b)^2 d (1-\cos (c+d x))^2}-\frac {(a-b) \sin (c+d x)}{4 (a+b)^3 d (1-\cos (c+d x))}-\frac {\sin (c+d x)}{12 (a+b)^2 d (1-\cos (c+d x))}+\frac {\sin (c+d x)}{12 (a-b)^2 d (1+\cos (c+d x))^2}+\frac {\sin (c+d x)}{12 (a-b)^2 d (1+\cos (c+d x))}+\frac {(a+b) \sin (c+d x)}{4 (a-b)^3 d (1+\cos (c+d x))}+\frac {a^3 b^2 \sin (c+d x)}{\left (a^2-b^2\right )^3 d (b+a \cos (c+d x))} \]

[Out]

-2*a^2*b^3*arctanh((a-b)^(1/2)*tan(1/2*d*x+1/2*c)/(a+b)^(1/2))/(a-b)^(7/2)/(a+b)^(7/2)/d-4*a^2*b*(a^2+b^2)*arc
tanh((a-b)^(1/2)*tan(1/2*d*x+1/2*c)/(a+b)^(1/2))/(a-b)^(7/2)/(a+b)^(7/2)/d-1/12*sin(d*x+c)/(a+b)^2/d/(1-cos(d*
x+c))^2-1/4*(a-b)*sin(d*x+c)/(a+b)^3/d/(1-cos(d*x+c))-1/12*sin(d*x+c)/(a+b)^2/d/(1-cos(d*x+c))+1/12*sin(d*x+c)
/(a-b)^2/d/(1+cos(d*x+c))^2+1/12*sin(d*x+c)/(a-b)^2/d/(1+cos(d*x+c))+1/4*(a+b)*sin(d*x+c)/(a-b)^3/d/(1+cos(d*x
+c))+a^3*b^2*sin(d*x+c)/(a^2-b^2)^3/d/(b+a*cos(d*x+c))

Rubi [A] (verified)

Time = 0.69 (sec) , antiderivative size = 343, normalized size of antiderivative = 1.00, number of steps used = 15, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.381, Rules used = {3957, 2976, 2729, 2727, 2743, 12, 2738, 214} \[ \int \frac {\csc ^4(c+d x)}{(a+b \sec (c+d x))^2} \, dx=-\frac {2 a^2 b^3 \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{d (a-b)^{7/2} (a+b)^{7/2}}-\frac {4 a^2 b \left (a^2+b^2\right ) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{d (a-b)^{7/2} (a+b)^{7/2}}+\frac {a^3 b^2 \sin (c+d x)}{d \left (a^2-b^2\right )^3 (a \cos (c+d x)+b)}-\frac {\sin (c+d x)}{12 d (a+b)^2 (1-\cos (c+d x))}-\frac {(a-b) \sin (c+d x)}{4 d (a+b)^3 (1-\cos (c+d x))}+\frac {(a+b) \sin (c+d x)}{4 d (a-b)^3 (\cos (c+d x)+1)}+\frac {\sin (c+d x)}{12 d (a-b)^2 (\cos (c+d x)+1)}-\frac {\sin (c+d x)}{12 d (a+b)^2 (1-\cos (c+d x))^2}+\frac {\sin (c+d x)}{12 d (a-b)^2 (\cos (c+d x)+1)^2} \]

[In]

Int[Csc[c + d*x]^4/(a + b*Sec[c + d*x])^2,x]

[Out]

(-2*a^2*b^3*ArcTanh[(Sqrt[a - b]*Tan[(c + d*x)/2])/Sqrt[a + b]])/((a - b)^(7/2)*(a + b)^(7/2)*d) - (4*a^2*b*(a
^2 + b^2)*ArcTanh[(Sqrt[a - b]*Tan[(c + d*x)/2])/Sqrt[a + b]])/((a - b)^(7/2)*(a + b)^(7/2)*d) - Sin[c + d*x]/
(12*(a + b)^2*d*(1 - Cos[c + d*x])^2) - ((a - b)*Sin[c + d*x])/(4*(a + b)^3*d*(1 - Cos[c + d*x])) - Sin[c + d*
x]/(12*(a + b)^2*d*(1 - Cos[c + d*x])) + Sin[c + d*x]/(12*(a - b)^2*d*(1 + Cos[c + d*x])^2) + Sin[c + d*x]/(12
*(a - b)^2*d*(1 + Cos[c + d*x])) + ((a + b)*Sin[c + d*x])/(4*(a - b)^3*d*(1 + Cos[c + d*x])) + (a^3*b^2*Sin[c
+ d*x])/((a^2 - b^2)^3*d*(b + a*Cos[c + d*x]))

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 214

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x/Rt[-a/b, 2]], x] /; FreeQ[{a, b},
x] && NegQ[a/b]

Rule 2727

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> Simp[-Cos[c + d*x]/(d*(b + a*Sin[c + d*x])), x]
/; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]

Rule 2729

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b*Cos[c + d*x]*((a + b*Sin[c + d*x])^n/(a*d
*(2*n + 1))), x] + Dist[(n + 1)/(a*(2*n + 1)), Int[(a + b*Sin[c + d*x])^(n + 1), x], x] /; FreeQ[{a, b, c, d},
 x] && EqQ[a^2 - b^2, 0] && LtQ[n, -1] && IntegerQ[2*n]

Rule 2738

Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x
]}, Dist[2*(e/d), Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}
, x] && NeQ[a^2 - b^2, 0]

Rule 2743

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((a + b*Sin[c + d*x])^(n
+ 1)/(d*(n + 1)*(a^2 - b^2))), x] + Dist[1/((n + 1)*(a^2 - b^2)), Int[(a + b*Sin[c + d*x])^(n + 1)*Simp[a*(n +
 1) - b*(n + 2)*Sin[c + d*x], x], x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 - b^2, 0] && LtQ[n, -1] && Integ
erQ[2*n]

Rule 2976

Int[cos[(e_.) + (f_.)*(x_)]^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(
m_), x_Symbol] :> Int[ExpandTrig[(d*sin[e + f*x])^n*(a + b*sin[e + f*x])^m*(1 - sin[e + f*x]^2)^(p/2), x], x]
/; FreeQ[{a, b, d, e, f}, x] && NeQ[a^2 - b^2, 0] && IntegersQ[m, 2*n, p/2] && (LtQ[m, -1] || (EqQ[m, -1] && G
tQ[p, 0]))

Rule 3957

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.), x_Symbol] :> Int[(g*Co
s[e + f*x])^p*((b + a*Sin[e + f*x])^m/Sin[e + f*x]^m), x] /; FreeQ[{a, b, e, f, g, p}, x] && IntegerQ[m]

Rubi steps \begin{align*} \text {integral}& = \int \frac {\cot ^2(c+d x) \csc ^2(c+d x)}{(-b-a \cos (c+d x))^2} \, dx \\ & = \int \left (\frac {1}{4 (a-b)^2 (-1-\cos (c+d x))^2}+\frac {-a-b}{4 (a-b)^3 (-1-\cos (c+d x))}+\frac {1}{4 (a+b)^2 (1-\cos (c+d x))^2}+\frac {a-b}{4 (a+b)^3 (1-\cos (c+d x))}+\frac {a^2 b^2}{\left (a^2-b^2\right )^2 (-b-a \cos (c+d x))^2}+\frac {2 a^2 b \left (a^2+b^2\right )}{\left (a^2-b^2\right )^3 (-b-a \cos (c+d x))}\right ) \, dx \\ & = \frac {\int \frac {1}{(-1-\cos (c+d x))^2} \, dx}{4 (a-b)^2}+\frac {(a-b) \int \frac {1}{1-\cos (c+d x)} \, dx}{4 (a+b)^3}+\frac {\int \frac {1}{(1-\cos (c+d x))^2} \, dx}{4 (a+b)^2}-\frac {(a+b) \int \frac {1}{-1-\cos (c+d x)} \, dx}{4 (a-b)^3}+\frac {\left (a^2 b^2\right ) \int \frac {1}{(-b-a \cos (c+d x))^2} \, dx}{\left (a^2-b^2\right )^2}+\frac {\left (2 a^2 b \left (a^2+b^2\right )\right ) \int \frac {1}{-b-a \cos (c+d x)} \, dx}{\left (a^2-b^2\right )^3} \\ & = -\frac {\sin (c+d x)}{12 (a+b)^2 d (1-\cos (c+d x))^2}-\frac {(a-b) \sin (c+d x)}{4 (a+b)^3 d (1-\cos (c+d x))}+\frac {\sin (c+d x)}{12 (a-b)^2 d (1+\cos (c+d x))^2}+\frac {(a+b) \sin (c+d x)}{4 (a-b)^3 d (1+\cos (c+d x))}+\frac {a^3 b^2 \sin (c+d x)}{\left (a^2-b^2\right )^3 d (b+a \cos (c+d x))}-\frac {\int \frac {1}{-1-\cos (c+d x)} \, dx}{12 (a-b)^2}+\frac {\int \frac {1}{1-\cos (c+d x)} \, dx}{12 (a+b)^2}+\frac {\left (a^2 b^2\right ) \int \frac {b}{-b-a \cos (c+d x)} \, dx}{\left (a^2-b^2\right )^3}+\frac {\left (4 a^2 b \left (a^2+b^2\right )\right ) \text {Subst}\left (\int \frac {1}{-a-b+(a-b) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{\left (a^2-b^2\right )^3 d} \\ & = -\frac {4 a^2 b \left (a^2+b^2\right ) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{(a-b)^{7/2} (a+b)^{7/2} d}-\frac {\sin (c+d x)}{12 (a+b)^2 d (1-\cos (c+d x))^2}-\frac {(a-b) \sin (c+d x)}{4 (a+b)^3 d (1-\cos (c+d x))}-\frac {\sin (c+d x)}{12 (a+b)^2 d (1-\cos (c+d x))}+\frac {\sin (c+d x)}{12 (a-b)^2 d (1+\cos (c+d x))^2}+\frac {\sin (c+d x)}{12 (a-b)^2 d (1+\cos (c+d x))}+\frac {(a+b) \sin (c+d x)}{4 (a-b)^3 d (1+\cos (c+d x))}+\frac {a^3 b^2 \sin (c+d x)}{\left (a^2-b^2\right )^3 d (b+a \cos (c+d x))}+\frac {\left (a^2 b^3\right ) \int \frac {1}{-b-a \cos (c+d x)} \, dx}{\left (a^2-b^2\right )^3} \\ & = -\frac {4 a^2 b \left (a^2+b^2\right ) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{(a-b)^{7/2} (a+b)^{7/2} d}-\frac {\sin (c+d x)}{12 (a+b)^2 d (1-\cos (c+d x))^2}-\frac {(a-b) \sin (c+d x)}{4 (a+b)^3 d (1-\cos (c+d x))}-\frac {\sin (c+d x)}{12 (a+b)^2 d (1-\cos (c+d x))}+\frac {\sin (c+d x)}{12 (a-b)^2 d (1+\cos (c+d x))^2}+\frac {\sin (c+d x)}{12 (a-b)^2 d (1+\cos (c+d x))}+\frac {(a+b) \sin (c+d x)}{4 (a-b)^3 d (1+\cos (c+d x))}+\frac {a^3 b^2 \sin (c+d x)}{\left (a^2-b^2\right )^3 d (b+a \cos (c+d x))}+\frac {\left (2 a^2 b^3\right ) \text {Subst}\left (\int \frac {1}{-a-b+(a-b) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{\left (a^2-b^2\right )^3 d} \\ & = -\frac {2 a^2 b^3 \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{(a-b)^{7/2} (a+b)^{7/2} d}-\frac {4 a^2 b \left (a^2+b^2\right ) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{(a-b)^{7/2} (a+b)^{7/2} d}-\frac {\sin (c+d x)}{12 (a+b)^2 d (1-\cos (c+d x))^2}-\frac {(a-b) \sin (c+d x)}{4 (a+b)^3 d (1-\cos (c+d x))}-\frac {\sin (c+d x)}{12 (a+b)^2 d (1-\cos (c+d x))}+\frac {\sin (c+d x)}{12 (a-b)^2 d (1+\cos (c+d x))^2}+\frac {\sin (c+d x)}{12 (a-b)^2 d (1+\cos (c+d x))}+\frac {(a+b) \sin (c+d x)}{4 (a-b)^3 d (1+\cos (c+d x))}+\frac {a^3 b^2 \sin (c+d x)}{\left (a^2-b^2\right )^3 d (b+a \cos (c+d x))} \\ \end{align*}

Mathematica [A] (verified)

Time = 1.38 (sec) , antiderivative size = 281, normalized size of antiderivative = 0.82 \[ \int \frac {\csc ^4(c+d x)}{(a+b \sec (c+d x))^2} \, dx=\frac {(b+a \cos (c+d x)) \sec ^2(c+d x) \left (\frac {48 a^2 b \left (2 a^2+3 b^2\right ) \text {arctanh}\left (\frac {(-a+b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right ) (b+a \cos (c+d x))}{\left (a^2-b^2\right )^{7/2}}-\frac {4 (2 a-b) (b+a \cos (c+d x)) \cot \left (\frac {1}{2} (c+d x)\right )}{(a+b)^3}-\frac {(b+a \cos (c+d x)) \cot \left (\frac {1}{2} (c+d x)\right ) \csc ^2\left (\frac {1}{2} (c+d x)\right )}{(a+b)^2}+\frac {24 a^3 b^2 \sin (c+d x)}{(a-b)^3 (a+b)^3}+\frac {4 (2 a+b) (b+a \cos (c+d x)) \tan \left (\frac {1}{2} (c+d x)\right )}{(a-b)^3}+\frac {(b+a \cos (c+d x)) \sec ^2\left (\frac {1}{2} (c+d x)\right ) \tan \left (\frac {1}{2} (c+d x)\right )}{(a-b)^2}\right )}{24 d (a+b \sec (c+d x))^2} \]

[In]

Integrate[Csc[c + d*x]^4/(a + b*Sec[c + d*x])^2,x]

[Out]

((b + a*Cos[c + d*x])*Sec[c + d*x]^2*((48*a^2*b*(2*a^2 + 3*b^2)*ArcTanh[((-a + b)*Tan[(c + d*x)/2])/Sqrt[a^2 -
 b^2]]*(b + a*Cos[c + d*x]))/(a^2 - b^2)^(7/2) - (4*(2*a - b)*(b + a*Cos[c + d*x])*Cot[(c + d*x)/2])/(a + b)^3
 - ((b + a*Cos[c + d*x])*Cot[(c + d*x)/2]*Csc[(c + d*x)/2]^2)/(a + b)^2 + (24*a^3*b^2*Sin[c + d*x])/((a - b)^3
*(a + b)^3) + (4*(2*a + b)*(b + a*Cos[c + d*x])*Tan[(c + d*x)/2])/(a - b)^3 + ((b + a*Cos[c + d*x])*Sec[(c + d
*x)/2]^2*Tan[(c + d*x)/2])/(a - b)^2))/(24*d*(a + b*Sec[c + d*x])^2)

Maple [A] (verified)

Time = 0.90 (sec) , antiderivative size = 242, normalized size of antiderivative = 0.71

method result size
derivativedivides \(\frac {\frac {\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3} a}{3}-\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3} b}{3}+3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) a +\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) b}{8 \left (a^{2}-2 a b +b^{2}\right ) \left (a -b \right )}-\frac {1}{24 \left (a +b \right )^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}-\frac {3 a -b}{8 \left (a +b \right )^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}+\frac {2 a^{2} b \left (-\frac {a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} b -a -b}-\frac {\left (2 a^{2}+3 b^{2}\right ) \operatorname {arctanh}\left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{\left (a -b \right )^{3} \left (a +b \right )^{3}}}{d}\) \(242\)
default \(\frac {\frac {\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3} a}{3}-\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3} b}{3}+3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) a +\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) b}{8 \left (a^{2}-2 a b +b^{2}\right ) \left (a -b \right )}-\frac {1}{24 \left (a +b \right )^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}-\frac {3 a -b}{8 \left (a +b \right )^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}+\frac {2 a^{2} b \left (-\frac {a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} b -a -b}-\frac {\left (2 a^{2}+3 b^{2}\right ) \operatorname {arctanh}\left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{\left (a -b \right )^{3} \left (a +b \right )^{3}}}{d}\) \(242\)
risch \(\frac {2 i \left (-6 a^{4} b \,{\mathrm e}^{7 i \left (d x +c \right )}-9 a^{2} b^{3} {\mathrm e}^{7 i \left (d x +c \right )}-6 a^{3} b^{2} {\mathrm e}^{6 i \left (d x +c \right )}-9 a \,b^{4} {\mathrm e}^{6 i \left (d x +c \right )}+14 a^{4} b \,{\mathrm e}^{5 i \left (d x +c \right )}+25 a^{2} b^{3} {\mathrm e}^{5 i \left (d x +c \right )}+6 b^{5} {\mathrm e}^{5 i \left (d x +c \right )}-6 a^{5} {\mathrm e}^{4 i \left (d x +c \right )}+40 a^{3} b^{2} {\mathrm e}^{4 i \left (d x +c \right )}+11 a \,b^{4} {\mathrm e}^{4 i \left (d x +c \right )}+2 a^{4} b \,{\mathrm e}^{3 i \left (d x +c \right )}-47 a^{2} b^{3} {\mathrm e}^{3 i \left (d x +c \right )}-4 a^{5} {\mathrm e}^{2 i \left (d x +c \right )}-30 a^{3} b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-11 a \,b^{4} {\mathrm e}^{2 i \left (d x +c \right )}-2 a^{4} b \,{\mathrm e}^{i \left (d x +c \right )}+15 a^{2} b^{3} {\mathrm e}^{i \left (d x +c \right )}+2 b^{5} {\mathrm e}^{i \left (d x +c \right )}+2 a^{5}+12 a^{3} b^{2}+a \,b^{4}\right )}{3 \left (a \,{\mathrm e}^{2 i \left (d x +c \right )}+2 b \,{\mathrm e}^{i \left (d x +c \right )}+a \right ) \left (-a^{2}+b^{2}\right ) d \left (a^{4}-2 a^{2} b^{2}+b^{4}\right ) \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{3}}+\frac {2 b \,a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a^{2}-i b^{2}-b \sqrt {a^{2}-b^{2}}}{\sqrt {a^{2}-b^{2}}\, a}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{3} \left (a -b \right )^{3} d}+\frac {3 b^{3} a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a^{2}-i b^{2}-b \sqrt {a^{2}-b^{2}}}{\sqrt {a^{2}-b^{2}}\, a}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{3} \left (a -b \right )^{3} d}-\frac {2 b \,a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+b \sqrt {a^{2}-b^{2}}}{\sqrt {a^{2}-b^{2}}\, a}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{3} \left (a -b \right )^{3} d}-\frac {3 b^{3} a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+b \sqrt {a^{2}-b^{2}}}{\sqrt {a^{2}-b^{2}}\, a}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{3} \left (a -b \right )^{3} d}\) \(719\)

[In]

int(csc(d*x+c)^4/(a+b*sec(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

1/d*(1/8/(a^2-2*a*b+b^2)/(a-b)*(1/3*tan(1/2*d*x+1/2*c)^3*a-1/3*tan(1/2*d*x+1/2*c)^3*b+3*tan(1/2*d*x+1/2*c)*a+t
an(1/2*d*x+1/2*c)*b)-1/24/(a+b)^2/tan(1/2*d*x+1/2*c)^3-1/8*(3*a-b)/(a+b)^3/tan(1/2*d*x+1/2*c)+2*a^2*b/(a-b)^3/
(a+b)^3*(-a*b*tan(1/2*d*x+1/2*c)/(tan(1/2*d*x+1/2*c)^2*a-tan(1/2*d*x+1/2*c)^2*b-a-b)-(2*a^2+3*b^2)/((a-b)*(a+b
))^(1/2)*arctanh((a-b)*tan(1/2*d*x+1/2*c)/((a-b)*(a+b))^(1/2))))

Fricas [A] (verification not implemented)

none

Time = 0.32 (sec) , antiderivative size = 1040, normalized size of antiderivative = 3.03 \[ \int \frac {\csc ^4(c+d x)}{(a+b \sec (c+d x))^2} \, dx=\text {Too large to display} \]

[In]

integrate(csc(d*x+c)^4/(a+b*sec(d*x+c))^2,x, algorithm="fricas")

[Out]

[-1/6*(22*a^5*b^2 - 14*a^3*b^4 - 8*a*b^6 + 2*(2*a^7 + 10*a^5*b^2 - 11*a^3*b^4 - a*b^6)*cos(d*x + c)^4 - 2*(4*a
^6*b - 7*a^4*b^3 + 2*a^2*b^5 + b^7)*cos(d*x + c)^3 - 3*(2*a^4*b^2 + 3*a^2*b^4 - (2*a^5*b + 3*a^3*b^3)*cos(d*x
+ c)^3 - (2*a^4*b^2 + 3*a^2*b^4)*cos(d*x + c)^2 + (2*a^5*b + 3*a^3*b^3)*cos(d*x + c))*sqrt(a^2 - b^2)*log((2*a
*b*cos(d*x + c) - (a^2 - 2*b^2)*cos(d*x + c)^2 + 2*sqrt(a^2 - b^2)*(b*cos(d*x + c) + a)*sin(d*x + c) + 2*a^2 -
 b^2)/(a^2*cos(d*x + c)^2 + 2*a*b*cos(d*x + c) + b^2))*sin(d*x + c) - 6*(a^7 + 6*a^5*b^2 - 5*a^3*b^4 - 2*a*b^6
)*cos(d*x + c)^2 + 10*(a^6*b - 2*a^4*b^3 + a^2*b^5)*cos(d*x + c))/(((a^9 - 4*a^7*b^2 + 6*a^5*b^4 - 4*a^3*b^6 +
 a*b^8)*d*cos(d*x + c)^3 + (a^8*b - 4*a^6*b^3 + 6*a^4*b^5 - 4*a^2*b^7 + b^9)*d*cos(d*x + c)^2 - (a^9 - 4*a^7*b
^2 + 6*a^5*b^4 - 4*a^3*b^6 + a*b^8)*d*cos(d*x + c) - (a^8*b - 4*a^6*b^3 + 6*a^4*b^5 - 4*a^2*b^7 + b^9)*d)*sin(
d*x + c)), -1/3*(11*a^5*b^2 - 7*a^3*b^4 - 4*a*b^6 + (2*a^7 + 10*a^5*b^2 - 11*a^3*b^4 - a*b^6)*cos(d*x + c)^4 -
 (4*a^6*b - 7*a^4*b^3 + 2*a^2*b^5 + b^7)*cos(d*x + c)^3 - 3*(2*a^4*b^2 + 3*a^2*b^4 - (2*a^5*b + 3*a^3*b^3)*cos
(d*x + c)^3 - (2*a^4*b^2 + 3*a^2*b^4)*cos(d*x + c)^2 + (2*a^5*b + 3*a^3*b^3)*cos(d*x + c))*sqrt(-a^2 + b^2)*ar
ctan(-sqrt(-a^2 + b^2)*(b*cos(d*x + c) + a)/((a^2 - b^2)*sin(d*x + c)))*sin(d*x + c) - 3*(a^7 + 6*a^5*b^2 - 5*
a^3*b^4 - 2*a*b^6)*cos(d*x + c)^2 + 5*(a^6*b - 2*a^4*b^3 + a^2*b^5)*cos(d*x + c))/(((a^9 - 4*a^7*b^2 + 6*a^5*b
^4 - 4*a^3*b^6 + a*b^8)*d*cos(d*x + c)^3 + (a^8*b - 4*a^6*b^3 + 6*a^4*b^5 - 4*a^2*b^7 + b^9)*d*cos(d*x + c)^2
- (a^9 - 4*a^7*b^2 + 6*a^5*b^4 - 4*a^3*b^6 + a*b^8)*d*cos(d*x + c) - (a^8*b - 4*a^6*b^3 + 6*a^4*b^5 - 4*a^2*b^
7 + b^9)*d)*sin(d*x + c))]

Sympy [F]

\[ \int \frac {\csc ^4(c+d x)}{(a+b \sec (c+d x))^2} \, dx=\int \frac {\csc ^{4}{\left (c + d x \right )}}{\left (a + b \sec {\left (c + d x \right )}\right )^{2}}\, dx \]

[In]

integrate(csc(d*x+c)**4/(a+b*sec(d*x+c))**2,x)

[Out]

Integral(csc(c + d*x)**4/(a + b*sec(c + d*x))**2, x)

Maxima [F(-2)]

Exception generated. \[ \int \frac {\csc ^4(c+d x)}{(a+b \sec (c+d x))^2} \, dx=\text {Exception raised: ValueError} \]

[In]

integrate(csc(d*x+c)^4/(a+b*sec(d*x+c))^2,x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*a^2-4*b^2>0)', see `assume?`
 for more de

Giac [A] (verification not implemented)

none

Time = 0.37 (sec) , antiderivative size = 457, normalized size of antiderivative = 1.33 \[ \int \frac {\csc ^4(c+d x)}{(a+b \sec (c+d x))^2} \, dx=-\frac {\frac {48 \, a^{3} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (a^{6} - 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} - b^{6}\right )} {\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a - b\right )}} - \frac {48 \, {\left (2 \, a^{4} b + 3 \, a^{2} b^{3}\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, a - 2 \, b\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {-a^{2} + b^{2}}}\right )\right )}}{{\left (a^{6} - 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} - b^{6}\right )} \sqrt {-a^{2} + b^{2}}} - \frac {a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 4 \, a^{3} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 6 \, a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 4 \, a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 9 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 24 \, a^{3} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 18 \, a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{6} - 6 \, a^{5} b + 15 \, a^{4} b^{2} - 20 \, a^{3} b^{3} + 15 \, a^{2} b^{4} - 6 \, a b^{5} + b^{6}} + \frac {9 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 3 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a + b}{{\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3}}}{24 \, d} \]

[In]

integrate(csc(d*x+c)^4/(a+b*sec(d*x+c))^2,x, algorithm="giac")

[Out]

-1/24*(48*a^3*b^2*tan(1/2*d*x + 1/2*c)/((a^6 - 3*a^4*b^2 + 3*a^2*b^4 - b^6)*(a*tan(1/2*d*x + 1/2*c)^2 - b*tan(
1/2*d*x + 1/2*c)^2 - a - b)) - 48*(2*a^4*b + 3*a^2*b^3)*(pi*floor(1/2*(d*x + c)/pi + 1/2)*sgn(2*a - 2*b) + arc
tan((a*tan(1/2*d*x + 1/2*c) - b*tan(1/2*d*x + 1/2*c))/sqrt(-a^2 + b^2)))/((a^6 - 3*a^4*b^2 + 3*a^2*b^4 - b^6)*
sqrt(-a^2 + b^2)) - (a^4*tan(1/2*d*x + 1/2*c)^3 - 4*a^3*b*tan(1/2*d*x + 1/2*c)^3 + 6*a^2*b^2*tan(1/2*d*x + 1/2
*c)^3 - 4*a*b^3*tan(1/2*d*x + 1/2*c)^3 + b^4*tan(1/2*d*x + 1/2*c)^3 + 9*a^4*tan(1/2*d*x + 1/2*c) - 24*a^3*b*ta
n(1/2*d*x + 1/2*c) + 18*a^2*b^2*tan(1/2*d*x + 1/2*c) - 3*b^4*tan(1/2*d*x + 1/2*c))/(a^6 - 6*a^5*b + 15*a^4*b^2
 - 20*a^3*b^3 + 15*a^2*b^4 - 6*a*b^5 + b^6) + (9*a*tan(1/2*d*x + 1/2*c)^2 - 3*b*tan(1/2*d*x + 1/2*c)^2 + a + b
)/((a^3 + 3*a^2*b + 3*a*b^2 + b^3)*tan(1/2*d*x + 1/2*c)^3))/d

Mupad [B] (verification not implemented)

Time = 14.13 (sec) , antiderivative size = 403, normalized size of antiderivative = 1.17 \[ \int \frac {\csc ^4(c+d x)}{(a+b \sec (c+d x))^2} \, dx=\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{24\,d\,{\left (a-b\right )}^2}+\frac {\frac {a^3-3\,a^2\,b+3\,a\,b^2-b^3}{3\,\left (a+b\right )}+\frac {2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (4\,a^4-13\,a^3\,b+15\,a^2\,b^2-7\,a\,b^3+b^4\right )}{3\,{\left (a+b\right )}^2}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (3\,a^5-13\,a^4\,b+38\,a^3\,b^2-18\,a^2\,b^3+7\,a\,b^4-b^5\right )}{{\left (a+b\right )}^3}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (8\,a^4-32\,a^3\,b+48\,a^2\,b^2-32\,a\,b^3+8\,b^4\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (8\,a^4-16\,a^3\,b+16\,a\,b^3-8\,b^4\right )\right )}+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {16\,a^2-16\,b^2}{64\,{\left (a-b\right )}^4}+\frac {1}{8\,{\left (a-b\right )}^2}\right )}{d}+\frac {a^2\,b\,\mathrm {atan}\left (\frac {1{}\mathrm {i}\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^6-3{}\mathrm {i}\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^4\,b^2+3{}\mathrm {i}\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2\,b^4-1{}\mathrm {i}\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^6}{{\left (a+b\right )}^{7/2}\,{\left (a-b\right )}^{5/2}}\right )\,\left (2\,a^2+3\,b^2\right )\,2{}\mathrm {i}}{d\,{\left (a+b\right )}^{7/2}\,{\left (a-b\right )}^{7/2}} \]

[In]

int(1/(sin(c + d*x)^4*(a + b/cos(c + d*x))^2),x)

[Out]

tan(c/2 + (d*x)/2)^3/(24*d*(a - b)^2) + ((3*a*b^2 - 3*a^2*b + a^3 - b^3)/(3*(a + b)) + (2*tan(c/2 + (d*x)/2)^2
*(4*a^4 - 13*a^3*b - 7*a*b^3 + b^4 + 15*a^2*b^2))/(3*(a + b)^2) - (tan(c/2 + (d*x)/2)^4*(7*a*b^4 - 13*a^4*b +
3*a^5 - b^5 - 18*a^2*b^3 + 38*a^3*b^2))/(a + b)^3)/(d*(tan(c/2 + (d*x)/2)^5*(8*a^4 - 32*a^3*b - 32*a*b^3 + 8*b
^4 + 48*a^2*b^2) - tan(c/2 + (d*x)/2)^3*(16*a*b^3 - 16*a^3*b + 8*a^4 - 8*b^4))) + (tan(c/2 + (d*x)/2)*((16*a^2
 - 16*b^2)/(64*(a - b)^4) + 1/(8*(a - b)^2)))/d + (a^2*b*atan((a^6*tan(c/2 + (d*x)/2)*1i - b^6*tan(c/2 + (d*x)
/2)*1i + a^2*b^4*tan(c/2 + (d*x)/2)*3i - a^4*b^2*tan(c/2 + (d*x)/2)*3i)/((a + b)^(7/2)*(a - b)^(5/2)))*(2*a^2
+ 3*b^2)*2i)/(d*(a + b)^(7/2)*(a - b)^(7/2))